package com.agg.domain.specification;

public abstract class BaseSpecification<T> implements Specification <T> {

    /**
     * {@inheritDoc}
     */
    @Override
    public abstract boolean isSatisfiedBy(T t);

    @Override
    public  Object dataHandle(Object t){
        return t;
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public Specification<T> and(final Specification<T> specification) {
        return new AndSpecification<T>(this, specification);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Specification<T> or(final Specification<T> specification) {
        return new OrSpecification<T>(this, specification);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Specification<T> not(final Specification<T> specification) {
        return new NotSpecification<T>(specification);
    }


}
